from ninja import Schema
from datetime import time
from decimal import Decimal
from typing import Optional

class ScheduleCreate(Schema):
    route_number: str
    start_station: str
    end_station: str
    departure_time: time
    estimated_duration: int
    bus_plate: str
    price: Decimal

class ScheduleUpdate(Schema):
    route_number: Optional[str] = None
    start_station: Optional[str] = None
    end_station: Optional[str] = None
    departure_time: Optional[time] = None
    estimated_duration: Optional[int] = None
    bus_plate: Optional[str] = None
    price: Optional[Decimal] = None

class ScheduleOut(Schema):
    id: int
    route_number: str
    start_station: str
    end_station: str
    departure_time: time
    estimated_duration: int
    bus_plate: str
    price: Decimal
    created_at: str